package crm.service.impl;

import java.sql.Connection;
import java.sql.SQLException;
import java.util.List;

import crm.dao.IndustryDao;
import crm.dao.impl.IndustryDaoImpl;
import crm.entity.Industry;
import crm.service.IndustryService;
import crm.utils.JdbcUtils;

public class IndustryServiceImpl implements IndustryService {

	private IndustryDao industryDao = new IndustryDaoImpl();
	
	public List<Industry> getIndustryList() throws InstantiationException, IllegalAccessException, NoSuchFieldException, SecurityException, SQLException {
		
		Connection connection = JdbcUtils.getConnection();
		
		String sql = "SELECT industry_id as industryID,industry_name as industryName FROM industry";
		
		List<Industry> industryList = industryDao.getIndustryList(connection, sql,Industry.class);
		
		
		return industryList;
	}

}
